<html>
  <head>
    {% if title %}
    <title>{{title}} - Microblog</title>
    {% else %}
    <title>microblog</title>
    {% endif %}
  </head>
  <body>
    <div>Microblog: 
    <a href="{{ url_for('index') }}">Home</a>
    {% if g.user.is_authenticated() %}
     |   <a href="{{ url_for('user', nickname = g.user.nickname) }}">个人资料</a>
     |   <a href="{{ url_for('logout') }}">退出登录</a>
    {% endif %}
    </div>
    <hr>
    {% with messages = get_flashed_messages() %}
    {% if messages %}
    </ul>
    {% for message in messages %}
        <li>{{ message }}</li>
     {% endfor %}
    <ul>
    {% endif %}
    {% endwith %}
    {% block content %}{% endblock %}
  </body>
</html>